package fr.gestionimmo.mangedbean;

import java.io.IOException;
import java.io.Serializable;
import java.util.Enumeration;

import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class MenuForm implements Serializable{

	private static final long serialVersionUID = -7197968156777632336L;
	protected final Log log = LogFactory.getLog(getClass());
	
	public String logOut()throws IOException {
		
		log.debug("logOut()");
		
		FacesContext facesContext = FacesContext.getCurrentInstance();
		ExternalContext externalContext = facesContext.getExternalContext();
		final HttpServletRequest request = (HttpServletRequest) externalContext.getRequest();
		request.getSession(false).invalidate();
		return "index";
			
	}

}
